<?php
namespace Coding\php\lib;


use Swoole\Database\PDOConfig;
use Swoole\Database\PDOPool;

class MysqlPool
{
    public static function instance()
    {
        /** @var PDOPool $pool */
        $pool = new PDOPool((new PDOConfig)
            ->withHost('127.0.0.1')
            ->withPort(3306)
            ->withDbName('wsaapp')
            ->withCharset('utf8mb4')
            ->withUsername('root')
            ->withPassword('root')
        );
        return $pool;
    }
}
